<template>
  <div class="jkpg">
     <nav class="navbar navbar-expand-sm bg-dark navbar-dark fixed-top">
  <img class="navbar-brand" src="../img/logo2.jpg" id="a1">
  <ul class="navbar-nav">
    <li class="nav-item">
      <a class="nav-link" href="#">欢迎{{$store.state.Login.name}}登录</a>
    </li>
  </ul>
</nav>
    <h1>健康评估</h1>
  <div class="bg-link">
    
        <a @click="zytznb" class="link-page" >
          <div class="risk-item item-two"  :style="{backgroundImage:'url(' + bg + ')', backgroundSize:'100% 100%',height:150}" >
            <div class="icon-text">
             <i class="el-icon-s-promotion"></i>
            <span>中医体质难辨</span>
            </div>
           </div>
          </a> 
      


    
        <a @click="xlwjpg" class="link-page">
          <div class="risk-item item-three" :style="{backgroundImage:'url(' + bg1 + ')', backgroundSize:'100% 100%',height:150}">
            <div class="icon-text">
                <i class="el-icon-thumb"></i>
          <span>心理问卷评估</span>
          </div>
          </div>
          </a> 
    </div>
  </div>
  
</template>

<script>
 import axios from 'axios' 
axios.defaults.baseURL="http://localhost:8085";
export default ({
   
  data(){
    return{
      bg: require('@/img/c.jpg'),
      bg1: require('@/img/d.jpg'),
      id:this.$store.state.Login.id,
      body:{},
      resule:{}
    }
  },
  methods:{
  zytznb(){ 
    if(this.body!="") {
      alert("你已回答完问题")
    }else{
	this.$router.push({
		path: '/About/zytznb',
	});
    }

  },
  xlwjpg(){  
    if(this.resule!=""){
      alert("你已回答完问题")
    }else{
   this.$router.push({
		path: '/About/xlwjpg',
	});
    }
  }
  },
  created(){

    axios.post("/selbody",{tMemberId:this.id}).then((respones)=>{
        this.body=respones.data

    }),

    axios.post("/seltmresule",{tMemberId:this.id}).then((respones)=>{
        this.resule=respones.data

    })
  }
})
</script>
<style scoped>
 .link-page {
    display: block;
}
.bg-link {
    padding: 3.3%;
    background-color: #fff;
}
.bg-link .risk-item .icon-text {
    position: absolute;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.bg-link .risk-item {
    margin-bottom: 3.3%;
    position: relative;
    background-repeat: no-repeat;
    background-position: 0 -2px;
    width: 100%;
    height: 143px;
    border-radius: 10px;
    background-size: cover;
    position: relative;
}


.bg-link .risk-item::before {
    content: '';
    width: 100%;
    height: 142px;
    background-color: #555555;
    opacity: .6;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 10px;
}

</style>